import hashlib
import string,random

str_buff = string.ascii_letters + string.digits + string.punctuation
str_alpha_buff = string.ascii_letters + string.digits


def md5(data: str):
    _md5 = hashlib.md5()
    _md5.update(data.encode("utf-8"))
    _hash = _md5.hexdigest()

    return _hash


def random_pass(size=8):
    return ''.join(random.sample(str_buff, size))



def random_biz(prefix, size=12):
    return prefix + ''.join(random.sample(str_alpha_buff, size))